﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

using RexToy.UI.WinForm.ViewModel;

namespace RexToy.UI.WinForm.Controls
{
    public class StatusBar : StatusStrip, IDataExchange
    {
        public StatusBar()
        {
            _exchange = true;
        }

        private bool _exchange;
        public bool Exchange
        {
            get { return _exchange; }
            set { _exchange = value; }
        }

        public void UpdateModel(ViewModelBase model)
        {
            //Note implement, should be readonly.
        }

        public void UpdateView(ViewModelBase model)
        {
            foreach (ToolStripItem item in Items)
            {
                var de = item as IDataExchange;
                if (de != null && de.Exchange)
                    de.UpdateView(model);
            }
        }

        public string BindPropertyName
        {
            get;
            set;
        }

        public UpdateModelTrigger UpdateModelTrigger
        {
            get;
            set;
        }
    }
}
